package viper.GUI;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

public class ViperGUI extends JFrame{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public final static ViperGUI INSTANCE = new ViperGUI();
	private ViperGUI(){
		
	}
	
	private JPanel currentJPanel = null;
	
	public void initialize(){
		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		setVisible(true);
		changePanel(new LoggedOutPanel());
	}
	
	public void changePanel(JPanel jPanel){
		if(currentJPanel!=null)
			getContentPane().remove(currentJPanel);
		getContentPane().add(jPanel, BorderLayout.CENTER);
		currentJPanel = jPanel;
		pack();
	}
}
